<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="apple-mobile-web-app-title" content="阿福易购">
    <meta content="telephone=no" name="format-detection" />
    <meta content="email=no" name="format-detection" />
    <!-- uc、qq浏览器 -->
    <meta name="screen-orientation" content="portrait">
    <meta name="full-screen" content="yes">
    <meta name="browsermode" content="application">
    <meta name="x5-orientation" content="portrait">
    <meta name="x5-fullscreen" content="true">
    <meta name="x5-page-mode" content="app">
    <meta name="HandheldFriendly" content="true">
    <meta name="MobileOptimized" content="320">
    <meta name="keywords" content="{{$SEO['keywords']}}"/>
    <meta name="description" content="{{$SEO['description']}}"/>
    <meta name="csrf-token" content="{{ csrf_token() }}" />
    <title>售后详情_{{$SEO['title']}}</title>
    <link rel="stylesheet" href="{{ asset('/build/css/app.min.css') }}">
</head>
<body ontouchstart="">


@if(!$refund_goods)
    退货商品不存在，请检查错误
@endif

@inject('refundGoodsOperationRecordService','App\Interfaces\RefundGoodsOperationRecordService')

@inject('userService','App\Interfaces\UserService')

@inject('goodsService','App\Interfaces\GoodsService')

@inject('pictureService','App\Interfaces\PictureService')

<?php
        $refundGoodsOperationRecord = $refundGoodsOperationRecordService->getByRefundSn($refund_goods->refund_sn);

        $refund_sn = $refund_goods->refund_sn;


        $goods = $goodsService->get($refund_goods->goods_id);
//dd($goods->toArray());
?>

<header class="ui-header ui-header-stable  af-header">
    <ul class="ui-row-flex">
        <li class="ui-col ui-flex ui-flex-pack-start">
            <i ontouchstart="window.history.back();" class="ui-icon-return"></i>
        </li>
        <li class="ui-col ui-flex ui-flex-pack-center">
            <h1>售后详情</h1>
        </li>
        <li class="ui-col ui-flex ui-flex-pack-end">
        </li>
    </ul>
</header>

<div class="ui-container">


    <ul class="ui-list ui-list-pure ui-border-tb" style="margin-bottom: 10px;">
        <li class="ui-border-t">
            <p class="ui-txt-info">售后服务单号：{{$refund_goods->refund_sn}}<span style="float: right">

                <?php

                    //退货商品的售后服务状态：1:待确认; 2:已受理；3:处理完毕；4:不予受理；5:已取消；
                    switch($refund_goods->refund_status){

                        case "1":

                            echo '待确认';
                            break;

                        case "2":

                            echo '已受理';
                            break;

                        case "3":

                            echo '处理完毕';
                            break;

                        case "4":

                            echo '不予受理';
                            break;

                        case "5":

                            echo '已取消';
                            break;
                    }
                ?>
            </span></p>
            <p class="ui-txt-muted">申请时间：

                @foreach($refundGoodsOperationRecord as $key=>$item)
                    <?php
                        if($refundGoodsOperationRecord->count()==($key+1)){
                            $last_status = $item->operation_status;
                        }
                    ?>

                    @if($item->operation_status==1)

                        {{$item->operation_time}}
                    @endif

                @endforeach
            </p>
        </li>
    </ul>
    <div class="ui-my-order-comment">
        <ul class="ui-list ui-list-function ui-border-tb">
            <li>
                <div data-href="/goods/show/{{$goods->goods_id}}" class="ui-list-img">
                    <span style="background-image:url({{$pictureService::thumb($goods->goods_thumb, 70, 70)}})"></span>
                </div>
                <div data-href="/goods/show/{{$goods->goods_id}}" class="ui-list-info">
                    <h4 class="ui-nowrap">{{$goods->goods_name}}</h4>
                    <p class="ui-nowrap">数量：{{$refund_goods->number}}</p>
                </div>
            </li>
        </ul>
    </div>
</div>

<script src="{{ asset('/build/lib/zepto.min.js') }}"></script>
<script src="{{ asset('/build/js/frozen.js') }}"></script>
<script src="{{ asset('/build/js/app.min.js') }}"></script>
</body>
</html>